Repository navigation
fix: 修复透视表组内排序在指标数据为 null 时排序异常的问题 - #3308
Conversation
Co-authored-by: Alexzjt <9548248+Alexzjt@users.noreply.github.com>
Co-authored-by: Alexzjt <9548248+Alexzjt@users.noreply.github.com>
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## next #3308 +/- ##
==========================================
+ Coverage 75.77% 78.74% +2.97%
==========================================
Files 257 224 -33
Lines 11994 12448 +454
Branches 2464 2817 +353
==========================================
+ Hits 9088 9802 +714
+ Misses 1398 945 -453
- Partials 1508 1701 +193 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
Size Change: +145 B (+0.02%) Total Size: 740 kB
ℹ️ View Unchanged
|
|
你好, @Copilot CI 执行失败, 请点击 [Details] 按钮查看, 并根据日志修复。 Hello, @Copilot CI run failed, please click the [Details] button for detailed log information and fix it. |
background你提到的这种实现逻辑(将 Null 视为最小值/负无穷)在数据库层面(如 MySQL)是常见的,但在面向用户的表格界面(UI/UX)中,这通常不是最佳实践。 业界最佳实践:Nulls Always Last (空值置底) 优点: 用户关注的是“有数据的项” action所以你需要增加一个空值的排序选项 nullsPlacement: 'first' | 'last' | 'auto' 如果用户自定义了排序函数,则排序函数完全接管 请你顺便在 s2-site 中补充api文档 |
Co-authored-by: Alexzjt <9548248+Alexzjt@users.noreply.github.com>
已按照业界最佳实践(Nulls Always Last)进行修改,新增 nullsPlacement: 'first' | 'last' | 'auto'
当用户自定义 API 文档已更新: 提交 commit: 0c077b0 |
|
@copilot sorry,我前面说错了。auto 的意思是 |
Co-authored-by: Alexzjt <9548248+Alexzjt@users.noreply.github.com>
|
/gemini review |
* Initial plan * fix: 修复透视表组内排序在指标数据为 null 时排序异常的问题 Co-authored-by: Alexzjt <9548248+Alexzjt@users.noreply.github.com> * fix: 修复测试用例中 createCellData 函数的类型定义 Co-authored-by: Alexzjt <9548248+Alexzjt@users.noreply.github.com> * feat: 添加 nullsPlacement 配置项,支持自定义空值排序位置 Co-authored-by: Alexzjt <9548248+Alexzjt@users.noreply.github.com> * fix: 修正 nullsPlacement='auto' 的行为(升序空值在前,降序空值在后) Co-authored-by: Alexzjt <9548248+Alexzjt@users.noreply.github.com> * fix: 提供更完善的全局配置 --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: Alexzjt <9548248+Alexzjt@users.noreply.github.com> Co-authored-by: zjt <alex_zjt@163.com>
修复透视表组内排序在指标数据为 null 时排序异常的问题
根据业界最佳实践(Nulls Always Last),修复透视表组内排序功能在指标数据为 null 时的排序问题。
新增 nullsPlacement 配置选项
在 SortParam 中新增
nullsPlacement配置项,支持用户自定义空值排序位置:'first''last''auto'变更说明
Sort接口中添加nullsPlacement?: NullsPlacement字段nullsPlacement='last',无论升序还是降序,空值都排在最后auto模式:升序时空值在前,降序时空值在后sortFunc时,排序逻辑完全由用户控制使用示例
Solve the issue and close #3306
Original prompt
💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.